(()=>{"use strict";var e,t={95686:(e,t,n)=>{var r=v(n(88209)),a=v(n(2958)),o=v(n(31934));n(96672),n(84200);var l=v(n(88640)),i=v(n(3787)),u=n(892),s=v(n(77183)),d=v(n(51585)),f=v(n(8543)),c=v(n(9500)),p=v(n(14554));function v(e){return e&&e.__esModule?e:{default:e}}o.default.extend(l.default),r.default.init(window.init),window.CTFd=r.default,window.helpers=p.default,window.$=a.default,window.dayjs=o.default,window.nunjucks=i.default,window.Howl=u.Howl,(0,a.default)((function(){(0,f.default)(),(0,c.default)(),(0,s.default)(d.default.urlRoot)}))},59193:(e,t,n)=>{n(95686);var r=n(80218),a=i(n(2958)),o=i(n(88209)),l=n(7144);function i(e){return e&&e.__esModule?e:{default:e}}function u(e,t){if(e){if("string"==typeof e)return s(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function d(e){var t,n,r,a=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=u(e))){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,l=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){i=!0,o=e},f:function(){try{l||null==n.return||n.return()}finally{if(i)throw o}}}}(document.cookie.split("; "));try{for(a.s();!(t=a.n()).done;){var o=(n=t.value.split("="),r=2,function(e){if(Array.isArray(e))return e}(n)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,o,l,i=[],u=!0,s=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(r=o.call(n)).done)&&(i.push(r.value),i.length!==t);u=!0);}catch(e){s=!0,a=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(s)throw a}}return i}}(n,r)||u(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),l=o[0],i=o[1];if(l===e)return decodeURIComponent(i)}}catch(e){a.e(e)}finally{a.f()}return null}var f='<div class="alert alert-danger alert-dismissable" role="alert">\n  <span class="sr-only">'+("en"===d("Scr1wCTFdLanguage")?"Error:":"错误：")+'</span>\n  {0}\n  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>\n</div>',c='<div class="alert alert-success alert-dismissable submit-row" role="alert">\n  <strong>'+("en"===d("Scr1wCTFdLanguage")?"Success!":"成功！")+"</strong>\n"+("en"===d("Scr1wCTFdLanguage")?"   Your profile has been updated\n":"   您的个人资料已更新\n")+'  <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>\n</div>';function p(e){e.preventDefault(),(0,a.default)("#results").empty();var t=(0,a.default)(this),n=t.serializeJSON(!0);for(var r in n.fields=[],n)if(r.match(/fields\[\d+\]/)){var l={},i=parseInt(r.slice(7,-1));l.field_id=i,l.value=n[r],n.fields.push(l),delete n[r]}o.default.api.patch_user_private({},n).then((function(e){e.success?(0,a.default)("#results").html(c):"errors"in e&&Object.keys(e.errors).map((function(n){var r=t.find("input[name={0}]".format(n)),o=(0,a.default)(r);o.addClass("input-filled-invalid"),o.removeClass("input-filled-valid");var l=e.errors[n];(0,a.default)("#results").append(f.format(l))}))}))}function v(e){e.preventDefault();var t=(0,a.default)(this).serializeJSON(!0);o.default.fetch("/api/v1/tokens",{method:"POST",body:JSON.stringify(t)}).then((function(e){return e.json()})).then((function(e){if(e.success){var t=(0,a.default)('\n        <p>Please copy your API Key, it won\'t be shown again!</p>\n        <div class="input-group mb-3">\n          <input type="text" id="user-token-result" class="form-control" value="'.concat(e.data.value,'" readonly>\n          <div class="input-group-append">\n            <button class="btn btn-outline-secondary" type="button">\n              <i class="fas fa-clipboard"></i>\n            </button>\n          </div>\n        </div>\n        '));t.find("button").click((function(e){(0,r.copyToClipboard)(e,"#user-token-result")})),(0,l.ezAlert)({title:"en"===d("Scr1wCTFdLanguage")?"API Key Generated":"API Key 生成成功",body:t,button:"en"===d("Scr1wCTFdLanguage")?"Got it!":"好的！",large:!0})}}))}function h(e){e.preventDefault();var t=(0,a.default)(this),n=t.data("token-id");(0,l.ezQuery)({title:"en"===d("Scr1wCTFdLanguage")?"Delete Token":"删除令牌",body:"en"===d("Scr1wCTFdLanguage")?"Are you sure you want to delete this token?":"您确定要删除此令牌吗？",success:function(){o.default.fetch("/api/v1/tokens/"+n,{method:"DELETE"}).then((function(e){return e.json()})).then((function(e){e.success&&t.parent().parent().remove()}))}})}(0,a.default)((function(){(0,a.default)("#user-profile-form").submit(p),(0,a.default)("#user-token-form").submit(v),(0,a.default)(".delete-token").click(h),(0,a.default)(".nav-pills a").click((function(e){window.location.hash=this.hash}));var e=window.location.hash;e&&(e=e.replace("<>[]'\"",""),(0,a.default)('.nav-pills a[href="'+e+'"]').tab("show"))}))}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var o=n[e]={id:e,loaded:!1,exports:{}};return t[e](o,o.exports,r),o.loaded=!0,o.exports}r.m=t,e=[],r.O=(t,n,a,o)=>{if(!n){var l=1/0;for(d=0;d<e.length;d++){for(var[n,a,o]=e[d],i=!0,u=0;u<n.length;u++)(!1&o||l>=o)&&Object.keys(r.O).every((e=>r.O[e](n[u])))?n.splice(u--,1):(i=!1,o<l&&(l=o));if(i){e.splice(d--,1);var s=a();void 0!==s&&(t=s)}}return t}o=o||0;for(var d=e.length;d>0&&e[d-1][2]>o;d--)e[d]=e[d-1];e[d]=[n,a,o]},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e={662:0,671:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var a,o,[l,i,u]=n,s=0;if(l.some((t=>0!==e[t]))){for(a in i)r.o(i,a)&&(r.m[a]=i[a]);if(u)var d=u(r)}for(t&&t(n);s<l.length;s++)o=l[s],r.o(e,o)&&e[o]&&e[o][0](),e[o]=0;return r.O(d)},n=self.webpackChunkctfd=self.webpackChunkctfd||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var a=r.O(void 0,[736,788],(()=>r(59193)));a=r.O(a)})();